package com.geekgo.ladder.core.base;

import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author geekgo
 * @version 2016/12/21 10:56
 */
public interface BaseProvider<T extends BaseModel> {

    @Transactional
    T update(T record);

    @Transactional
    void delete(Long id,Long userId);

    T queryById(Long id);

    Page<T> query(Map<String,Object> params);

    <K> Page<K> getPage(Page<Long> ids,Class<K> cls);

    <K> List<K> getList(List<Long> ids,Class<K> cls);

}
